import request from '@/utils/request'

// 创建农事记录
export function createFarmRecord(data) {
  return request({
    url: '/agri/farm-record/create',
    method: 'post',
    data: data
  })
}

// 更新农事记录
export function updateFarmRecord(data) {
  return request({
    url: '/agri/farm-record/update',
    method: 'put',
    data: data
  })
}

// 删除农事记录
export function deleteFarmRecord(id) {
  return request({
    url: '/agri/farm-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得农事记录
export function getFarmRecord(id) {
  return request({
    url: '/agri/farm-record/get?id=' + id,
    method: 'get'
  })
}

// 获得农事记录分页
export function getFarmRecordPage(query) {
  return request({
    url: '/agri/farm-record/page',
    method: 'get',
    params: query
  })
}

// 导出农事记录 Excel
export function exportFarmRecordExcel(query) {
  return request({
    url: '/agri/farm-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
